import request from './request'

/**
 * Recipient related API
 */
export const recipientAPI = {
  getList(params) {
    return request({
      url: '/recipients',
      method: 'get',
      params
    })
  },

  getDetail(id) {
    return request({
      url: `/recipients/${id}`,
      method: 'get'
    })
  },

  create(data) {
    return request({
      url: '/recipients',
      method: 'post',
      data
    })
  },

  update(id, data) {
    return request({
      url: `/recipients/${id}`,
      method: 'put',
      data
    })
  },

  delete(id) {
    return request({
      url: `/recipients/${id}`,
      method: 'delete'
    })
  }
}
